send events
Identifying Senders and Receivers
When you receive a high-level event, part of the information returned by
AcceptHighLevelEvent is the sender of the event. You can use that
information to respond selectively to requests made by other applications or to
know which application to send any replies to. The information about the
sender is provided in the form of a TargetID record
The sessionID field corresponds to the session reference number created by
the PPC Toolbox. This is a 32-bit number that uniquely identifies a
PPC Toolbox session (or connection) with another application. The name
and location fields contain the sender's port name and port location (and have
no meaning when posting an event). If the sending application is on the same
machine as the receiving application, you can determine the sending
application's ProcessSerialNumber by calling the function named
When you post a high-level event, you can specify its recipient in one of four
ways:
by port name and port location (specified in a targetID record)
by a sessionID
by the application's creator signature
by a ProcessSerialNumber
Note that to specify the recipient of a high-level event sent to an application
across a network, you can use only its targetID or its sessionID. You can use
any of the four ways when sending high-level events to applications on the
local machine.
When you are replying to a high-level event, it is easy to identify the
recipient because you can use the targetID record that you receive from
AcceptHighLevelEvent, the sessionID contained in that targetID record, or
the ProcessSerialNumber (if the receiving process is local). Note that
replying by sessionID is always the fastest way to respond to a
high-level event.
When you are not replying to a previous event, you need to determine the
identity of the target application yourself. You can use one of several methods
to do this. If the target application is on the local machine, you can search for
that application's creator signature or its ProcessSerialNumber by calling the
If the application to which you want to send a high-level event is located on a
remote machine, you need to identify it either by its sessionID or by its
targetID. You can call the PPCBrowser function to let the user browse for a
specific port. You can call the IPCListPorts function to obtain a list of all
ports registered with the target PPC Toolbox.